﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HSDc.RingleFlow.Kernel.Dto.ProcessDefinition
{
    internal class ProcessDefinition
    {
        internal string Id { get; set; }
        internal string Name { get; set; }
        internal int Version { get; set; }
        internal bool Enabled { get; set; }
        internal List<Swimlane> Swimlanes { get; set; }
        internal List<Activity> Activities { get; set; }
    }

    internal class Swimlane
    {
        internal string Id { get; set; }
        internal int Seq { get; set; }
        internal string Name { get; set; }
        internal string RuleClassName { get; set; }
    }

    internal class Activity
    {
        internal string Id { get; set; }
        internal string Name { get; set; }
        internal ActivityType Type { get; set; }
        internal string RuleClassName { get; set; }
        internal int RealId { get; set; }
        internal Swimlane Swimlane { get; set; }
        internal List<Transition> InboundTransitions { get; set; }
        internal List<Transition> OutboundTransitions { get; set; }
    }

    internal class Transition
    {
        internal string Id { get; set; }
        internal Activity Source { get; set; }
        internal Activity Target { get; set; }
    }

    internal enum ActivityType
    {
        [DescriptionAttribute("HSDc.RingleFlow.Kernel.ProcessActivity.HumanActivity")]
        HumanActivity,
        [DescriptionAttribute("HSDc.RingleFlow.Kernel.ProcessActivity.ForkActivity")]
        ForkActivity,
        [DescriptionAttribute("HSDc.RingleFlow.Kernel.ProcessActivity.JoinActivity")]
        JoinActivity,
        [DescriptionAttribute("HSDc.RingleFlow.Kernel.ProcessActivity.DecisionActivity")]
        DecisionActivity,
        [DescriptionAttribute("HSDc.RingleFlow.Kernel.ProcessActivity.EndActivity")]
        EndActivity
    }
}
